<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>广告管理</title>
	<meta name="decorator" content="default"/>
    <link rel="stylesheet" href="${ctxStatic}/ckfinder/plugins/gallery/colorbox/colorbox.css" />
    <script src="${ctxStatic}/ckfinder/plugins/gallery/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
	<script type="text/javascript">

		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/pub/adMake/">广告列表</a></li>
		<%--<shiro:hasPermission name="pub:adMake:edit"><li><a href="${ctx}/pub/adMake/form">广告添加</a></li></shiro:hasPermission>--%>
	</ul>
	<form:form id="searchForm" modelAttribute="adMake" action="${ctx}/pub/adMake/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<%--<li><label>点位编号：</label>--%>
				<%--<form:input path="point.id" htmlEscape="false" maxlength="64" class="input-medium"/>--%>
			<%--</li>--%>
			<li><label>审核标记：</label>
				<form:radiobuttons onclick="$('#searchForm').submit();" path="delFlag" items="${fns:getDictList('ad_del_flag')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>点位名称</th>
				<th>用户名称</th>
				<th>广告时长</th>
				<th>播放周期</th>
                <th>总金额</th>
				<th>更新时间</th>
				<shiro:hasPermission name="pub:adMake:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="adMake">
			<tr>
				<td>
					${adMake.point.name}
				</a></td>
				<td>
					${adMake.user.name}
				</td>
				<td>
					${adMake.adTime}
				</td>
				<td>
					${adMake.adCycle}
				</td>
                <td>
                    ${adMake.rmbCount}
                </td>
				<td>
					<fmt:formatDate value="${adMake.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
                    <a class="preview" href="javascript:void(0);" data-id="${adMake.id}">预览</a>
                    <c:forTokens items="${adMake.images}" delims="|" var="str">
                        <a class="group-${adMake.id}" href="${ctxs}${str}" style="display: none;">pic1</a>
                    </c:forTokens>
                    <script type="text/javascript">
                        $("a.group-${adMake.id}").colorbox({rel: "group-${adMake.id}",scalePhotos:true,maxWidth:400,maxHeight:800});
                    </script>
                    <shiro:hasPermission name="pub:adMake:edit">
    				<%--<a href="${ctx}/pub/adMake/form?id=${adMake.id}">修改</a>--%>
                    <shiro:hasPermission name="pub:adMake:audit">
					<a href="${ctx}/pub/adMake/delete?id=${adMake.id}${adMake.delFlag ne 0?'&isRe=true':''}" onclick="return confirmx('确认要${adMake.delFlag ne 0?'审核通过':'删除'}该广告吗？', this.href)">${adMake.delFlag ne 0?'审核通过':'删除'}</a>
                    </shiro:hasPermission></shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
<script type="text/javascript">
    $(document).ready(function() {
        $(".preview").click(function(){
//            alert("测试");
            $(".group-" + $(this).attr("data-id")).eq(0).click();
        });
    });
</script>

</body>
</html>